package com.nlelpct.system.controller;

import com.nlelpct.system.model.vo.ESLogVo;
import com.nlelpct.system.service.impl.LogBaseService;
import com.nlelpct.utils.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author 刘伟涛
 * @Date 2023/10/24 14:56
 **/
@RequestMapping("/log")
@RestController
public class SysSystemLogController {

    @Resource
    private LogBaseService logBaseService;

    @PostMapping("/getOptLogs")
    Result getOptLogs(@RequestBody ESLogVo vo){
        return logBaseService.getOptLogs(vo);
    }

    @GetMapping("/getOptLogById/{id}")
    Result getOptLogById(@PathVariable("id") String id){
        return logBaseService.getOptLogById(id);
    }

    @GetMapping("/getOperateTypeList")
    Result getOperateTypeList(){
        return logBaseService.getOperateTypeList();
    }

    /**
     * 批量导出系统操作日志
     * @param ids ID列表
     * @return 导出批量操作日志
     */
    @PostMapping("/exportOptLogByIds")
    public Result exportOptLogByIds(@RequestBody List<String> ids) throws Exception {
        Result result = logBaseService.exportOptLogByIds(ids);
        return result;
    }

    /**
     * 全量导出系统操作日志
     * @param vo vo列表
     * @return 导出全量操作日志
     */
/*    @PostMapping("/exportAllOptLog")
    public Result exportAllOptLog(@RequestBody ESLogVo vo) throws Exception {
        return logBaseService.exportAllOptLog(vo);
    }*/
}
